// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = (event, context) => {
  const db = cloud.database()
  console.log(event)
  var data={
    openidThree: "",
    openidFour: "",
    openidFive: "",
    brandidTwo:"",
    brandidThree:"",
    brandidFour: "",
    brandidFive: "",
    scanCodeTimeThree:"",
    scanCodeTimeFour:"",
    scanCodeTimeFive:"",
    isSubmitThree:false,
    isSubmitFour:false,
    isSubmitFive:false,
    device_logicid:"",
    gprs_number:""
    }
     event.list.map((item,index)=>{
      data.brandidTwo=item.brandid
      data.device_logicid=item.device_logicid
      data.gprs_number=item.gprs_number
      db.collection('scanCode').add({
        data: data,
      })
    })
}
